import java.util.Arrays;

/**
 * User: Роман
 * Date: 25.02.13
 * Time: 9:13
 */
public class Brute {

    public static void main(String[] args) {
        //drawing preparation
        StdDraw.clear();
        StdDraw.setPenColor(StdDraw.BLUE);
        StdDraw.setXscale(0, 32768);
        StdDraw.setYscale(0, 32768);
        //reading points
        Point[] points;
        String filename = args[0];
        In in = new In(filename);
        Integer numberOfPoints = in.readInt();
        points = new Point[numberOfPoints];
        int counter = 0;
        while (counter < numberOfPoints) {
            points[counter] = new Point(in.readInt(), in.readInt());
            points[counter].draw();
            counter++;
        }
        //determening subsets of 4 collinear points
        Arrays.sort(points);
        for (int i = 0; i < numberOfPoints; i++)
            for (int j = i + 1; j < numberOfPoints; j++)
                for (int k = j + 1; k < numberOfPoints; k++)
                    for (int l = k + 1; l < numberOfPoints; l++)
                        if ((i != j) && (i != k) && (i != l) && (j != k) && (j != l) && (k != l))
                            if (areCollinear(points, i, j, k, l)){
                                System.out.println(points[i] + "->" + points[j] + "->" + points[k] + "->" + points[l]);
                                points[i].drawTo(points[l]);
                            }


    }

    private static boolean areCollinear(Point[] points, int i, int j, int k, int l) {
        double slopeIJ = points[i].slopeTo(points[j]);
        double slopeIK = points[i].slopeTo(points[k]);
        double slopeIL = points[i].slopeTo(points[l]);
        if ((slopeIJ == slopeIK) && (slopeIK == slopeIL))
            return true;
        return false;
    }
}